home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / vis082s.arc / VALID.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-17  |  2KB  |  101 lines

  1. program validate;
  2.  
  3. uses dos,crt;
  4.  
  5. type
  6.     string15 = String[35];
  7.     SerialType = Record
  8.         id: string15;
  9.         Sysop : String[80];
  10.         end;
  11.  
  12. const
  13.     SerialNum : SerialType =
  14.         ( id:'[ Evaluation Copy ]'; Sysop:'[ Unregistered BBS ]');
  15.  
  16. var
  17.     ch: char;
  18.     s: serialtype;
  19.     x: byte;
  20.     c,new: longint;
  21.     f: file;
  22.     Ser: SerialType;
  23.         dummy:string15;
  24.         shitbags:string15;
  25.         a,b:integer;
  26.  
  27. procedure Encode(var ser: SerialType);
  28. var tp1:string15;
  29.     tp2:string[80];
  30.     i:integer;
  31. begin
  32. tp1:='';
  33. for i:=1 to length(ser.id) do tp1:=tp1+chr(ord(ser.id[i])+i);
  34. tp2:='';
  35. for i:=1 to length(ser.sysop) do tp2:=tp2+chr(ord(ser.sysop[i])+i);
  36. ser.id:=tp1;
  37. ser.sysop:=tp2;
  38. end;
  39.  
  40. procedure Decode(var s: SerialType);
  41. begin
  42. end;
  43.  
  44. procedure GetSerial(var S: SerialType; var c: longint);
  45. var
  46.     f: file;
  47. begin
  48.     assign(f, 'VISION.EXE');
  49.     reset(f,1);
  50.     c:=FileSize(f);
  51.     c:=c-SizeOf(SerialType);
  52.     s.id:='';
  53.     while (c>0) and (s.Id <> SerialNum.ID ) do
  54.         begin
  55.         seek(f,c);
  56.         blockread(f,s,SizeOf(s));
  57.         Dec(c);
  58.         end;
  59.     close(f);
  60.    inc(c);
  61. end;
  62.  
  63. begin
  64. b:=2*5;
  65. a:=b div 2;
  66. b:=a+b;
  67.         clrscr;
  68.         textcolor(15);
  69.                 dummy:='Crimson Blade';
  70.                 write('ViSiON BBS registration utility for ');
  71.                 textcolor(14);
  72.                 writeln(dummy);
  73.                 textcolor(15);
  74.                 write('Searching for... ');
  75.                 textcolor(13);
  76.                 writeln(serialnum.id);
  77.                 writeln;           textcolor(15);
  78.     write('Searching File: ');textcolor(12);write('VISION.EXE');textcolor(15);
  79.   write('...');
  80.     GetSerial(Ser,c);
  81.     ser.sysop:='Countdown To Chaos';
  82.         ser.id:=dummy;
  83.         configset.eatmesl:=b-a;
  84.   encode(ser);
  85.     assign(f, 'VISION.EXE' );
  86.     reset(f,1);
  87.     s.id:='';
  88.     while (c>0) and (s.id <>SerialNum.ID ) do begin
  89.         seek(f,c);
  90.         blockread(f,s,SizeOf(serialnum));
  91.         Dec(c);
  92.         end;
  93.     if ( c > 0 ) then begin
  94.         Seek(f,c+1);
  95.         {SerialNum.Sysop :=Ser.Sysop; }
  96.         BlockWrite(f,Ser,SizeOf(Ser));
  97.         end;
  98.     close(f);
  99.  
  100. end.
  101.